package org.kernely.ui.mvp;

import java.util.EventObject;

/**
 * This event is used by View to notify their Presenter that they are attached.
 * Usefull to have embedde images : when the bind method is called, the view
 * is not attached to the application. Therefore displaying image will cause
 * an exception. The "trick" is to send an event in the "attach" method in
 * the View, and then handle it in the Presenter, by verifying that:
 * 			- the event is an instanceof KernelyAttachedEvent
 * 			- the source of the event is an instance of the View
 */
@SuppressWarnings("serial")
public class KernelyAttachedEvent extends KernelyEvent{

	/**
	 * KernelyEvent's constructor
	 * @param source : the sender which fires the event
	 */
	public KernelyAttachedEvent(KernelyEventSender source) {
		super(source);
	}

	/**
	 * Returns the source of this event
	 */
	@Override
	public KernelyEventSender getSource() {
		return (KernelyEventSender) super.getSource();
	}
}
